package cn.colins.raft.rpc.handler.chanel;


import cn.colins.raft.enity.HeartBeatResult;
import cn.colins.raft.enity.RequestVoteRPC;
import cn.colins.raft.enity.RequestVoteResult;
import cn.colins.raft.node.FollowRaftNode;
import cn.colins.raft.node.RaftNodeService;
import cn.colins.raft.rpc.domin.RpcRemoteMsg;
import cn.colins.raft.utils.ThreadPoolUtils;
import com.alibaba.fastjson.JSONObject;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description  投票请求处理类
 * @Author czl
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2023/6/12
 */
public class VoteRpcHandler extends SimpleChannelInboundHandler<RequestVoteRPC> {
    private static final Logger log = LoggerFactory.getLogger(VoteRpcHandler.class);



    @Override
    protected void channelRead0(ChannelHandlerContext context, RequestVoteRPC rpcResponse) throws Exception {
        // 投票请求处理
        RaftNodeService.callVoteHandler(rpcResponse,context.channel());
    }


}
